package cn.huijielong.modules.pub.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

import cn.huijielong.common.utils.Query;
import cn.huijielong.modules.pub.dao.RegisterDao;
import cn.huijielong.modules.pub.entity.RegisterEntity;
import cn.huijielong.modules.pub.service.RegisterService;
import cn.huijielong.modules.sys.service.impl.SimpleServiceImpl;



@Service("registerService")
public class RegisterServiceImpl extends SimpleServiceImpl implements RegisterService {
	@Autowired
	private RegisterDao registerDao;
	
	@Override
	public RegisterEntity queryObject(Long userId){
		return registerDao.queryObject(userId);
	}
	
	@Override
	public Page<RegisterEntity> queryList(Query q){
	    Page<RegisterEntity> page=PageHelper.startPage(q.getPage(), q.getLimit()).doSelectPage(()-> registerDao.queryList(q));
		return page;		
	}
	
	@Override
	public int queryTotal(Map<String, Object> map){
		return registerDao.queryTotal(map);
	}
	
	@Override
	public void save(RegisterEntity register){
		registerDao.save(register);
	}
	
	@Override
	public void update(RegisterEntity register){
		registerDao.update(register);
	}
	
	@Override
	public void delete(Long userId){
		registerDao.delete(userId);
	}
	
	@Override
	public void deleteBatch(Long[] userIds){
		registerDao.deleteBatch(userIds);
	}
	
}
